home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 3: Developer Tools / Linux Cubed Series 3 - Developer Tools.iso / devel / lang / eiffel / smalleif.97 / se.t / SmallEiffel / lib_test / test_reverse_assignment.e < prev    next >
Encoding:
Text File  |  1996-05-02  |  1.1 KB  |  65 lines

  1. -- Part of SmallEiffel -- Read DISCLAIMER file -- Copyright (C) 
  2. -- Dominique COLNET and Suzanne COLLIN -- colnet@loria.fr
  3. --
  4. class TEST_REVERSE_ASSIGNMENT
  5.  
  6. creation {ANY}
  7.    make
  8.    
  9. feature {ANY}
  10.    
  11.    string: STRING;
  12.    animal: ANIMAL;
  13.    cat: CAT;
  14.    dog: DOG;
  15.    any: ANY;
  16.    
  17.    array_integer: ARRAY[INTEGER];
  18.    array_any: ARRAY[ANY];
  19.    
  20.    make is
  21.       do
  22.      any := "foo";
  23.      is_true(any /= Void);
  24.      string ?= any;
  25.      is_true(string /= Void);
  26.      is_true(any = string);
  27.      
  28.      cat ?= any;
  29.      is_true(cat = Void);
  30.      
  31.      any := 3;
  32.      string ?= any;
  33.      is_true(string = Void);
  34.      
  35.      !!cat;
  36.      any := cat;
  37.      is_true(cat = any);
  38.      dog ?= any;
  39.      is_true(dog = Void);
  40.      cat ?= any;
  41.      is_true(cat = any);
  42.      animal := cat;
  43.      cat ?= animal;
  44.      is_true(cat = animal);
  45.      animal := Void;
  46.      cat ?= animal;
  47.      is_true(cat = Void);
  48.       end;
  49.    
  50.    is_true(b: BOOLEAN) is
  51.       do
  52.      cpt := cpt + 1;
  53.      if not b then
  54.         std_output.put_string("TEST_REVERSE_ASSIGNMENT: ERROR Test # ");
  55.         std_output.put_integer(cpt);
  56.         std_output.put_string("%N");
  57.      else
  58.         -- std_output.put_string("Yes %N");
  59.      end;
  60.       end;
  61.    
  62.    cpt: INTEGER;
  63.    
  64. end -- TEST_REVERSE_ASSIGNMENT
  65.